package novel.common.test;

/**
 * Created by sutong on 2017/10/24.
 */
public class Consumer implements Runnable {
    public PublicBoxx obj;

    public Consumer(PublicBoxx obj) {
        this.obj = obj;
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println("消费苹果次数"+i);
            try {
                Thread.sleep(0);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            obj.decreace();
        }
    }
}
